
function minipanel(key,varnames,f=stdout,history=history_short)
    means = mean(h[key] for h in history)
    sds = sqrt.( mean((h[key].-means).^2 for h in history) )
    if isa(varnames,AbstractArray)
        for t=1:length(varnames)
            minirow(varnames[t],means[t,:],sds[t,:],f)
        end
    else
        minirow(varnames,means,sds,f)
    end
end

function minirow(varname,meanvec::AbstractArray,sdvec::AbstractArray,f=stdout)
    println(f,varname*" & "*join(round.(meanvec,digits=3)," & ")*" \\\\")
    println(f," & ("*join(round.(sdvec,digits=3),") & (")*") \\\\")
end

function minirow(varname,fun,f=stdout,history=history_short)
    meanvec = [mean(fun(h)[t] for h in history_short) for t=1:4]
    sdvec = [std(fun(h)[t] for h in history_short) for t=1:4]
    minirow(varname,meanvec,sdvec,f)
end

const typenames = ["Male Private","Male Public","Female Private","Female Public"]
